﻿/*
*┌────────────────────────────────────────────────┐
*│　描    述：DataSetUtility                                                   
*│　作    者： (Jxw)                                             
*│　版    本：1.0                                              
*│　创建时间：2020/8/21 10:21:57                        
*└────────────────────────────────────────────────┘
*/
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Utility
{
    public class DataSetUtility
    {
        
        //public static string ToldConStr = ConfigurationManager.ConnectionStrings["ToldConnString"].ToString();
        //public static string ManageConStr = ConfigurationManager.ConnectionStrings["ManageConnString"].ToString();
        //public static DataSet GetDataSetFromTold(StringBuilder sb)
        //{
        //    return SqlHelper.ExecuteDataset(WebConfig.ToldConStr, CommandType.Text, sb.ToString(), null);
        //}
        //public static DataSet GetDataSetFromTold(StringBuilder sb, SqlParameter sp)
        //{
        //    return SqlHelper.ExecuteDataset(WebConfig.ToldConStr, CommandType.Text, sb.ToString(), sp);
        //}
        //public static DataSet GetDataSetFromTold(StringBuilder sb, SqlParameter[] sps)
        //{
        //    return SqlHelper.ExecuteDataset(WebConfig.ToldConStr, CommandType.Text, sb.ToString(), sps);
        //}
        //public static int GetNonQueryFromTold(StringBuilder sb)
        //{
        //    return SqlHelper.ExecuteNonQuery(WebConfig.ToldConStr, CommandType.Text, sb.ToString(), null);
        //}
        //public static int GetNonQueryFromTold(StringBuilder sb, SqlParameter sp)
        //{
        //    return SqlHelper.ExecuteNonQuery(WebConfig.ToldConStr, CommandType.Text, sb.ToString(), sp);
        //}
        //public static int GetNonQueryFromTold(StringBuilder sb, SqlParameter[] sps)
        //{
        //    return SqlHelper.ExecuteNonQuery(WebConfig.ToldConStr, CommandType.Text, sb.ToString(), sps);
        //}

        public static DataSet GetDataSetFromMain(StringBuilder sb)
        {
            return SqlHelper.ExecuteDataset(AppConfig.MainConStr, CommandType.Text, sb.ToString(), null);
        }
        public static DataSet GetDataSetFromMain(StringBuilder sb, SqlParameter sp)
        {
            return SqlHelper.ExecuteDataset(AppConfig.MainConStr, CommandType.Text, sb.ToString(), sp);
        }
        public static DataSet GetDataSetFromMain(StringBuilder sb, SqlParameter[] sps)
        {
            return SqlHelper.ExecuteDataset(AppConfig.MainConStr, CommandType.Text, sb.ToString(), sps);
        }
        #region GPS
        //public static DataSet GetDataSetFromGPS(StringBuilder sb, SqlParameter sp)
        //{
        //    return SqlHelper.ExecuteDataset(GPSConStr, CommandType.Text, sb.ToString(), sp);
        //}
        #endregion

        #region CDB
        public static DataSet GetDataSetFromCDB(StringBuilder sb, SqlParameter sp)
        {
            return SqlHelper.ExecuteDataset(AppConfig.CDBConStr, CommandType.Text, sb.ToString(), sp);
        }
        public static DataSet GetDataSetFromCDB(StringBuilder sb)
        {
            return SqlHelper.ExecuteDataset(AppConfig.CDBConStr, CommandType.Text, sb.ToString(), null);
        }
        public static DataSet GetDataSetFromCDB(StringBuilder sb, SqlParameter[] sp)
        {
            return SqlHelper.ExecuteDataset(AppConfig.CDBConStr, CommandType.Text, sb.ToString(), sp);
        }
        #endregion
        //public static DataSet GetDataSetFromManage(StringBuilder sb)
        //{
        //    return SqlHelper.ExecuteDataset(WebConfig.ManageConStr, CommandType.Text, sb.ToString(), null);
        //}
        //public static DataSet GetDataSetFromManage(StringBuilder sb, SqlParameter sp)
        //{
        //    return SqlHelper.ExecuteDataset(WebConfig.ManageConStr, CommandType.Text, sb.ToString(), sp);
        //}
        //public static DataSet GetDataSetFromManage(StringBuilder sb, SqlParameter[] sps)
        //{
        //    return SqlHelper.ExecuteDataset(WebConfig.ManageConStr, CommandType.Text, sb.ToString(), sps);
        //}
    }
}
